/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package seso;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "M3ShOrderSKU", catalog = "MIS", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "M3ShOrderSKU.findAll", query = "SELECT m FROM M3ShOrderSKU m"),
    @NamedQuery(name = "M3ShOrderSKU.findByCoNo", query = "SELECT m FROM M3ShOrderSKU m WHERE m.coNo = :coNo"),
    @NamedQuery(name = "M3ShOrderSKU.findByOrderNo", query = "SELECT m FROM M3ShOrderSKU m WHERE m.m3ShOrderSKUPK.orderNo = :orderNo"),
    @NamedQuery(name = "M3ShOrderSKU.findByOrderLine", query = "SELECT m FROM M3ShOrderSKU m WHERE m.m3ShOrderSKUPK.orderLine = :orderLine"),
    @NamedQuery(name = "M3ShOrderSKU.findByFacility", query = "SELECT m FROM M3ShOrderSKU m WHERE m.facility = :facility"),
    @NamedQuery(name = "M3ShOrderSKU.findByItemNo", query = "SELECT m FROM M3ShOrderSKU m WHERE m.itemNo = :itemNo"),
    @NamedQuery(name = "M3ShOrderSKU.findBySeason", query = "SELECT m FROM M3ShOrderSKU m WHERE m.season = :season"),
    @NamedQuery(name = "M3ShOrderSKU.findByLabel", query = "SELECT m FROM M3ShOrderSKU m WHERE m.label = :label"),
    @NamedQuery(name = "M3ShOrderSKU.findByQuality", query = "SELECT m FROM M3ShOrderSKU m WHERE m.quality = :quality"),
    @NamedQuery(name = "M3ShOrderSKU.findByStyle", query = "SELECT m FROM M3ShOrderSKU m WHERE m.style = :style"),
    @NamedQuery(name = "M3ShOrderSKU.findByColor", query = "SELECT m FROM M3ShOrderSKU m WHERE m.color = :color"),
    @NamedQuery(name = "M3ShOrderSKU.findBySize", query = "SELECT m FROM M3ShOrderSKU m WHERE m.size = :size"),
    @NamedQuery(name = "M3ShOrderSKU.findByQuantity", query = "SELECT m FROM M3ShOrderSKU m WHERE m.quantity = :quantity"),
    @NamedQuery(name = "M3ShOrderSKU.findBySalesPrice", query = "SELECT m FROM M3ShOrderSKU m WHERE m.salesPrice = :salesPrice"),
    @NamedQuery(name = "M3ShOrderSKU.findByStatus", query = "SELECT m FROM M3ShOrderSKU m WHERE m.status = :status")})
public class M3ShOrderSKU implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected M3ShOrderSKUPK m3ShOrderSKUPK;
    @Basic(optional = false)
    @Column(name = "CoNo")
    private String coNo;
    @Basic(optional = false)
    @Column(name = "Facility")
    private String facility;
    @Basic(optional = false)
    @Column(name = "ItemNo")
    private String itemNo;
    @Basic(optional = false)
    @Column(name = "Season")
    private String season;
    @Basic(optional = false)
    @Column(name = "Label")
    private String label;
    @Column(name = "Quality")
    private String quality;
    @Column(name = "Style")
    private String style;
    @Column(name = "Color")
    private String color;
    @Column(name = "Size")
    private String size;
    @Column(name = "Quantity")
    private Integer quantity;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "SalesPrice")
    private BigDecimal salesPrice;
    @Basic(optional = false)
    @Column(name = "Status")
    private char status;

    public M3ShOrderSKU() {
    }

    public M3ShOrderSKU(M3ShOrderSKUPK m3ShOrderSKUPK) {
        this.m3ShOrderSKUPK = m3ShOrderSKUPK;
    }

    public M3ShOrderSKU(M3ShOrderSKUPK m3ShOrderSKUPK, String coNo, String facility, String itemNo, String season, String label, char status) {
        this.m3ShOrderSKUPK = m3ShOrderSKUPK;
        this.coNo = coNo;
        this.facility = facility;
        this.itemNo = itemNo;
        this.season = season;
        this.label = label;
        this.status = status;
    }

    public M3ShOrderSKU(int orderNo, int orderLine) {
        this.m3ShOrderSKUPK = new M3ShOrderSKUPK(orderNo, orderLine);
    }

    public M3ShOrderSKUPK getM3ShOrderSKUPK() {
        return m3ShOrderSKUPK;
    }

    public void setM3ShOrderSKUPK(M3ShOrderSKUPK m3ShOrderSKUPK) {
        this.m3ShOrderSKUPK = m3ShOrderSKUPK;
    }

    public String getCoNo() {
        return coNo;
    }

    public void setCoNo(String coNo) {
        String oldCoNo = this.coNo;
        this.coNo = coNo;
        changeSupport.firePropertyChange("coNo", oldCoNo, coNo);
    }

    public String getFacility() {
        return facility;
    }

    public void setFacility(String facility) {
        String oldFacility = this.facility;
        this.facility = facility;
        changeSupport.firePropertyChange("facility", oldFacility, facility);
    }

    public String getItemNo() {
        return itemNo;
    }

    public void setItemNo(String itemNo) {
        String oldItemNo = this.itemNo;
        this.itemNo = itemNo;
        changeSupport.firePropertyChange("itemNo", oldItemNo, itemNo);
    }

    public String getSeason() {
        return season;
    }

    public void setSeason(String season) {
        String oldSeason = this.season;
        this.season = season;
        changeSupport.firePropertyChange("season", oldSeason, season);
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        String oldLabel = this.label;
        this.label = label;
        changeSupport.firePropertyChange("label", oldLabel, label);
    }

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        String oldQuality = this.quality;
        this.quality = quality;
        changeSupport.firePropertyChange("quality", oldQuality, quality);
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        String oldStyle = this.style;
        this.style = style;
        changeSupport.firePropertyChange("style", oldStyle, style);
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        String oldColor = this.color;
        this.color = color;
        changeSupport.firePropertyChange("color", oldColor, color);
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        String oldSize = this.size;
        this.size = size;
        changeSupport.firePropertyChange("size", oldSize, size);
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        Integer oldQuantity = this.quantity;
        this.quantity = quantity;
        changeSupport.firePropertyChange("quantity", oldQuantity, quantity);
    }

    public BigDecimal getSalesPrice() {
        return salesPrice;
    }

    public void setSalesPrice(BigDecimal salesPrice) {
        BigDecimal oldSalesPrice = this.salesPrice;
        this.salesPrice = salesPrice;
        changeSupport.firePropertyChange("salesPrice", oldSalesPrice, salesPrice);
    }

    public char getStatus() {
        return status;
    }

    public void setStatus(char status) {
        char oldStatus = this.status;
        this.status = status;
        changeSupport.firePropertyChange("status", oldStatus, status);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (m3ShOrderSKUPK != null ? m3ShOrderSKUPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof M3ShOrderSKU)) {
            return false;
        }
        M3ShOrderSKU other = (M3ShOrderSKU) object;
        if ((this.m3ShOrderSKUPK == null && other.m3ShOrderSKUPK != null) || (this.m3ShOrderSKUPK != null && !this.m3ShOrderSKUPK.equals(other.m3ShOrderSKUPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "seso.M3ShOrderSKU[ m3ShOrderSKUPK=" + m3ShOrderSKUPK + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
